<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="/WEB-INF/jstl/c.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function editShardTest(selectedObj){
	var form = document.getElementById("shardTestForm");
    var tr = selectedObj.parentNode.parentNode;
    var td = tr.cells[0];
    var id = td.innerHTML;
    form.action = id;
    document.getElementById("_method").value = "GET";
    form.submit();
}
function deleteShardTest(selectedObj){
	var form = document.getElementById("shardTestForm");
	var tr = selectedObj.parentNode.parentNode;
    var td = tr.cells[0];
    var id = td.innerHTML;
    form.action = id;
    document.getElementById("_method").value = "DELETE";
    form.submit();
}
function addShardTest(){
    location.href="shardtestedit.jsp";
}
function getShardTest(){
    var form = document.getElementById("shardTestForm");
    form.action = document.getElementById("id").value;
    document.getElementById("_method").value = "GET";
    document.forms[0].submit();
}
</script>
<title>Insert title here</title>
</head>
<body>
	<form id="shardTestForm" action="" method="POST">
	<input type="hidden" id="_method" name="_method" value="POST"/>
	   <table id="shardTestListTable">
	       <tr><td>用户编号${contextPath} ${request.contextPath} ${request.path} ${request.ctx} ${path} ${ctx} ${servletPath} ${pageContext.request.contextPath}</td><td>用户名称</td><td>用户年龄</td><td>用户备注</td></tr>
	       <c:forEach items="${list}" var="shardTestBean" varStatus="st"> 
                <tr>
	                <td>${shardTestBean.id} </td>
	                <td>${shardTestBean.shardTestName}</td>
	                <td>${shardTestBean.age}</td>
	                <td>${shardTestBean.remark}</td>
	                <td><input type="button" value="修改" onclick="editShardTest(this)"></td>
	                <td><input type="button" value="删除" onclick="deleteShardTest(this)"></td>
                </tr>
           </c:forEach>
	   </table>
	   <input type="button" value="添加" onclick="addShardTest()">
	</form>

</body>
</html>